using UnityEngine;
using System.Collections;

public class InteractGenerateBall : InteractObject
{
    public Vector3 topOffset = new Vector3();

    void Start() { }

    override public void Interact(MonoBehaviour sender)
    {
        if (Input.GetKeyDown(interactButton))
        {
            GameObject sphere = GameObject.CreatePrimitive(PrimitiveType.Sphere);
            sphere.AddComponent("Rigidbody");
            sphere.tag = "FlySphere";

            Rigidbody rigidbody = (Rigidbody) sphere.GetComponent("Rigidbody");
            rigidbody.useGravity = true;

            sphere.transform.position = transform.position + topOffset;
        }
    }
}
